package com.ssy.wireless.web.vo.req;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
public class HotspotQueryVo {
    private Long hotspotType;
    private Long entId;
    private String name;
    private String joinBeginTime;
    private String joinEndTime;

    public Long getHotspotType() {
        return hotspotType;
    }

    public void setHotspotType(Long hotspotType) {
        this.hotspotType = hotspotType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJoinBeginTime() {
        return joinBeginTime;
    }

    public void setJoinBeginTime(String joinBeginTime) {
        this.joinBeginTime = joinBeginTime;
    }

    public String getJoinEndTime() {
        return joinEndTime;
    }

    public void setJoinEndTime(String joinEndTime) {
        this.joinEndTime = joinEndTime;
    }

    public Long getEntId() {
        return entId;
    }

    public void setEntId(Long entId) {
        this.entId = entId;
    }

    public Map<String, Object> queryParams() {
        Map<String, Object> params = new HashMap();
        params.put("entId", this.getEntId());
        params.put("type", null != this.getHotspotType() && this.getHotspotType().intValue() > 0 ? this.getHotspotType() : null);
        params.put("name", StringUtils.hasLength(this.getName()) ? "%" + this.getName() + "%" : null);
        params.put("joinBeginTime", StringUtils.hasLength(this.getJoinBeginTime()) ? this.getJoinBeginTime() + " 00:00:00" : null);
        params.put("joinEndTime", StringUtils.hasLength(this.getJoinEndTime()) ? this.getJoinEndTime() + " 23:59:59" : null);
        return params;
    }
}
